/**
 * Company : SIANGKLOM.
 * Created By : Chatree Siangklom
 * Created On : Oct 9, 2013  5:17:00 PM 
 * e-Mail : dr_chatree@hotmail.com
 * Mobile Phone : (+66) 087-921-5115
 * Package Name : com.tis.database.services.staging
 * File Name : IFiDepositReturnOutbServices.java
 * TODO
 */
package com.tis.database.services.staging;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import org.hibernate.HibernateException;

import sap.business.enumeration.STAGING_STATUS;

import com.tis.database.entitys.SapMessage;
import com.tis.database.entitys.staging.FiDepositReturnOutb;
import com.tis.database.entitys.staging.StampObject;

/**
 * @author Chatree Siangklom of Administrator
 * Date =Oct 9, 2013 : 5:17:00 PM 
 * CreateBy=Chatree Siangklom
 * 
 * IFiDepositReturnOutbServices
 * TODO
 */
public interface IFiDepositReturnOutbServices {

	/**
	 * 
	 * Date =Oct 11, 2013 : 2:06:07 PM 
	 * CreateBy=Chatree Siangklom
	 * List<FiDepositReturnOutb>
	 * TODO
	 * @param id
	 * @param sapstagingId
	 * @param company
	 * @param project
	 * @param documentNo
	 * @param refDocNo
	 * @param accountCode
	 * @param accountCode2
	 * @param unitNo
	 * @param status
	 * @param instanceNo
	 * @param syncIssync
	 * @param interfaceOnStart
	 * @param interfaceOnEnd
	 * @param maxResult
	 * @return
	 * @throws HibernateException
	 * @throws Exception
	 */
	List<FiDepositReturnOutb> Search(	
									String id, 
									String sapstagingId,
									String company,
									String project,
									String documentNo,
									String refDocNo,
									String accountCode,
									String accountCode2,
									String unitNo,
									String status,	
									String instanceNo,
									String syncIssync,
									String interfaceOnStart, 
									String interfaceOnEnd,
									int maxResult) throws HibernateException, Exception;
	
	void saveOrUpdate(FiDepositReturnOutb e) throws HibernateException, Exception;
	
	void saveOrUpdate(List<FiDepositReturnOutb> e) throws HibernateException, Exception;
	
	FiDepositReturnOutb findById(String id) throws HibernateException, Exception;
	
	BigDecimal NextInstanceNo() throws HibernateException, Exception;
	
	BigDecimal NextSequence(String name) throws HibernateException, Exception;
	
	BigDecimal NextSequence() throws HibernateException, Exception;
	
	List<FiDepositReturnOutb> UpdateBackSapMessage(List<SapMessage> sapMessages) throws HibernateException, Exception;
	
	java.util.Date getCurrentDatabaseDate() throws HibernateException, Exception;
	
	void StampUsedTime(StampObject stampObject, FiDepositReturnOutb e) throws Exception;
	
    void StampUsedTimePROC(String instanceNo, Date procStartTime, Date procEndTime, FiDepositReturnOutb e) throws Exception;
    
    void StampUsedTimeSend(String instanceNo, Date sendUseStart, Date sendUseEnd, FiDepositReturnOutb e) throws Exception;
    
    void StampUsedTimePms(String instanceNo, Date pmsUseStart, Date pmsUseEnd, FiDepositReturnOutb e) throws Exception;
    
    List<FiDepositReturnOutb> findByInstanceNo(String instanceNo, FiDepositReturnOutb e) throws HibernateException, Exception;
    
    void SaveErrorToStaging(String instanceNo, STAGING_STATUS Staging_STATUS, String error);
}
